package com.topboya.officeuser.entity;

import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * user
 */

/**
 * 用户表(User)实体类
 *
 * @author makejava
 * @since 2020-08-07 10:18:55
 */
@Data
public class User implements Serializable {
    private static final long serialVersionUID = -61038227803600985L;
    /**
     * 编号
     */
    private String id;
    /**
     * 归属公司
     */
    private String companyId;
    /**
     * 归属部门
     */
    private String officeId;
    /**
     * 登录名
     */
    private String loginName;
    /**
     * 密码
     */
    private String password;
    /**
     * 姓名
     */
    private String name;
    /**
     * 邮箱
     */
    private String email;
    /**
     * 电话
     */
    private String phone;

    private Integer salary;
    /**
     * 创建者
     */
    private String createBy;
    /**
     * 创建时间
     */
    private Date createDate;
    /**
     * 更新者
     */
    private String updateBy;
    /**
     * 更新时间
     */
    private Date updateDate;
    /**
     * 备注信息
     */
    private String remarks;
    /**
     * 删除标记
     */
    private String delFlag;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return Objects.equals(id, user.id) &&
                Objects.equals(companyId, user.companyId) &&
                Objects.equals(officeId, user.officeId) &&
                Objects.equals(loginName, user.loginName) &&
                Objects.equals(password, user.password) &&
                Objects.equals(name, user.name) &&
                Objects.equals(email, user.email) &&
                Objects.equals(phone, user.phone) &&
                Objects.equals(createBy, user.createBy) &&
                Objects.equals(createDate, user.createDate) &&
                Objects.equals(updateBy, user.updateBy) &&
                Objects.equals(updateDate, user.updateDate) &&
                Objects.equals(remarks, user.remarks) &&
                Objects.equals(delFlag, user.delFlag);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, companyId, officeId, loginName, password, name, email, phone, createBy, createDate, updateBy, updateDate, remarks, delFlag);
    }

    public User(String id, String loginName, String name, String email) {
        this.id = id;
        this.loginName = loginName;
        this.name = name;
        this.email = email;
    }

    public User() {
    }
}